import request from '@/utils/request'

// 获取正在直播的直播间列表
export function getLiveRoom(query) {
	return request({
		url: '/system/LiveModular/getLiveRoom',
		method: 'get',
		params: query
	})
}

// 获取直播间推荐列表
export function recommend(query) {
	return request({
		url: '/system/LiveModular/recommend',
		method: 'get',
		params: query
	})
}

// 关注
export function attention(data) {
	return request({
		url: '/system/LiveModular/attention',
		method: 'post',
		data: data
	})
}

// 获取用户签到历史
export function getSignHistory(userId) {
	return request({
		url: '/system/LiveModular/getSignHistory?userId=' + userId,
		method: 'get'
	})
}


// 新增直播间信息
export function addLivebroadcastingroom(data) {
  return request({
    url: '/system/Livebroadcastingroom',
    method: 'post',
    data: data
  })
}


// 查询直播间信息
export function anchorInfo(query) {
	return request({
		url: '/system/LiveModular/anchorInfo',
		method: 'get',
		params: query
	})
}

// 更新直播间信息
export function updataroom(data) {
  return request({
    url: '/system/LiveModular/updataroom',
    method: 'post',
    data: data
  })
}

// 查询礼物信息
export function getGift(query) {
	return request({
		url: '/system/GiftModular/list',
		method: 'get',
		params: query
	})
}

// 送礼物
export function givegift(data) {
	return request({
		url: '/system/GiftModular/givegift',
		method: 'post',
		data: data
	})
}


// 开启录制
export function modeStart(query) {
	return request({
		url: '/system/Recording/getresourceId',
		method: 'get',
		params: query
	})
}


// 结束录制
export function modeStop(query) {
	return request({
		url: '/system/Recording/modeStop',
		method: 'get',
		params: query
	})
}

//获取腾讯云UserSig
export function getTxUserSig(userId) {
	return request({
		url: '/system/LiveModular/getUserSig?userId=' + userId,
		method: 'get',
	})
}

// 主播发起秒杀
export function onshelve(data) {
  return request({
    url: '/system/SeckillModularController/onshelve',
    method: 'post',
    data: data
  })
}

// 用户获取秒杀信息
export function getshelve(data) {
  return request({
    url: '/system/SeckillModularController/getshelve',
    method: 'post',
    data: data
  })
}

// 用户参与秒杀
export function joinshelve(data) {
  return request({
    url: '/system/SeckillModularController/joinshelve',
    method: 'post',
    data: data
  })
}